package com.ss.progress.dao.impl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.ss.progress.dao.CalendarDao;
import com.ss.progress.pojo.CalendarDetailInfo;
import com.ss.progress.pojo.CalendarInfo;
/**
 * 教学日历dao实现
 * @author Administrator
 *
 */
@Repository("calendarDao")
public class CalendarDaoImpl extends SqlMapClientDaoSupport implements CalendarDao {

	@Override
	public List<CalendarInfo> queryCalendar(CalendarInfo info) throws Exception {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().queryForList("calendar.queryCalendar",info);
	}

	@Override
	public void addCalendar(CalendarInfo info) throws Exception {
		// TODO Auto-generated method stub
		this.getSqlMapClientTemplate().insert("calendar.addCalendar",info);
	}

	@Override
	public int updateCalendar(CalendarInfo info) throws Exception {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().update("calendar.updateCalendar",info);
	}

	@Override
	public List<CalendarDetailInfo> queryCalendarDetail(CalendarDetailInfo info)
			throws Exception {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().queryForList("calendar.queryCalendarDetail",info);
	}

	@Override
	public void addCalendarDetail(CalendarDetailInfo info) throws Exception {
		// TODO Auto-generated method stub
		this.getSqlMapClientTemplate().insert("calendar.addCalendarDetail",info);
	}

	@Override
	public int updateCalendarDetail(CalendarDetailInfo info) throws Exception {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().update("calendar.updateCalendarDetail",info);
	}

	@Override
	public CalendarDetailInfo getCalendarDetailById(String id)
			throws Exception {
		// TODO Auto-generated method stub
		return (CalendarDetailInfo)this.getSqlMapClientTemplate().queryForObject("calendar.getCalendarDetailById",id);
	}
	
}
